-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version	5.1.37-community-log


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;


--
-- Create schema pinguim
--

CREATE DATABASE IF NOT EXISTS pinguim;
USE pinguim;

--
-- Definition of table `tp001`
--

DROP TABLE IF EXISTS `tp001`;
CREATE TABLE `tp001` (
  `P01` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Codigo do usuario',
  `P02` int(10) unsigned NOT NULL COMMENT 'Codigo da empresa do usaurio',
  `P03` int(10) unsigned NOT NULL COMMENT 'Codigo do grupo do usuario',
  `P04` varchar(50) NOT NULL COMMENT 'Login do usuario',
  `P05` varchar(25) NOT NULL COMMENT 'Senha do usuario',
  `P06` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'usuario bloquado 1 sim 0 nao',
  PRIMARY KEY (`P01`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COMMENT='Tabela de login do usuario';

--
-- Dumping data for table `tp001`
--

/*!40000 ALTER TABLE `tp001` DISABLE KEYS */;
INSERT INTO `tp001` (`P01`,`P02`,`P03`,`P04`,`P05`,`P06`) VALUES 
 (1,1,1,'ADMIN','ADMIN',0);
/*!40000 ALTER TABLE `tp001` ENABLE KEYS */;


--
-- Definition of table `tp002`
--

DROP TABLE IF EXISTS `tp002`;
CREATE TABLE `tp002` (
  `P01` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Codigo dos dados do usuario',
  `P02` int(11) NOT NULL COMMENT 'Codigo do login do usario',
  `P03` varchar(100) NOT NULL COMMENT 'nome completo do usuario',
  `P04` varchar(200) DEFAULT NULL COMMENT 'Endereço do suaurio',
  `P05` varchar(100) DEFAULT NULL COMMENT 'Bairro do usuario',
  `P06` char(9) DEFAULT NULL COMMENT 'Cep do usuario',
  `P07` varchar(50) DEFAULT NULL COMMENT 'Cidade do usuario',
  `P08` char(2) DEFAULT NULL COMMENT 'UF do usuario',
  `P09` tinyint(1) DEFAULT NULL COMMENT 'status do usuario',
  PRIMARY KEY (`P01`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COMMENT='tabela de dados do usuario';

--
-- Dumping data for table `tp002`
--

/*!40000 ALTER TABLE `tp002` DISABLE KEYS */;
INSERT INTO `tp002` (`P01`,`P02`,`P03`,`P04`,`P05`,`P06`,`P07`,`P08`,`P09`) VALUES 
 (2,1,'JUCELIO ANCELMO ALENCAR','RUA LUIZ ATONIO FRAGOZO','PATRIARCA','033355000','SÃO PAULO','SP',0);
/*!40000 ALTER TABLE `tp002` ENABLE KEYS */;


--
-- Definition of table `tp003`
--

DROP TABLE IF EXISTS `tp003`;
CREATE TABLE `tp003` (
  `P01` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Codigo da grupo do usario',
  `P02` varchar(100) NOT NULL COMMENT 'nome do grupo do usario',
  `P03` tinyint(1) NOT NULL COMMENT 'status do grupo',
  PRIMARY KEY (`P01`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COMMENT='Grupos de Usuarios';

--
-- Dumping data for table `tp003`
--

/*!40000 ALTER TABLE `tp003` DISABLE KEYS */;
INSERT INTO `tp003` (`P01`,`P02`,`P03`) VALUES 
 (1,'ADMINISTRADOR',0);
/*!40000 ALTER TABLE `tp003` ENABLE KEYS */;


--
-- Definition of table `tp004`
--

DROP TABLE IF EXISTS `tp004`;
CREATE TABLE `tp004` (
  `P01` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Codigo do modulo',
  `P02` varchar(100) NOT NULL COMMENT 'Nome do modulo',
  `P03` varchar(45) NOT NULL COMMENT 'Nome fisico do modulo',
  `P04` tinyint(1) DEFAULT NULL COMMENT 'status do modulo',
  PRIMARY KEY (`P01`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Tabela de modulos do sistemas';

--
-- Dumping data for table `tp004`
--

/*!40000 ALTER TABLE `tp004` DISABLE KEYS */;
/*!40000 ALTER TABLE `tp004` ENABLE KEYS */;


--
-- Definition of table `tp005`
--

DROP TABLE IF EXISTS `tp005`;
CREATE TABLE `tp005` (
  `P01` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Codigo da permisao',
  `P02` int(10) unsigned NOT NULL COMMENT 'Codigo do usario da permisao',
  `P03` int(10) unsigned NOT NULL COMMENT 'Codigo do Modelo do sustema',
  `P04` tinyint(1) DEFAULT NULL COMMENT 'Pode Visualizar',
  `P05` tinyint(1) DEFAULT NULL COMMENT 'Pode Adicionar',
  `P06` tinyint(1) DEFAULT NULL COMMENT 'Pode Editar',
  `P07` tinyint(1) DEFAULT NULL COMMENT 'Pode Excluir',
  `P08` tinyint(1) DEFAULT NULL COMMENT 'Pode Imprimir',
  PRIMARY KEY (`P01`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Tabela de permisoes para usario por modulos ';

--
-- Dumping data for table `tp005`
--

/*!40000 ALTER TABLE `tp005` DISABLE KEYS */;
/*!40000 ALTER TABLE `tp005` ENABLE KEYS */;


--
-- Definition of table `tp006`
--

DROP TABLE IF EXISTS `tp006`;
CREATE TABLE `tp006` (
  `P01` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Codigo da empresa',
  `P02` varchar(100) NOT NULL COMMENT 'Nome da Empresa',
  `P03` varchar(100) NOT NULL COMMENT 'CNPJ da empresa',
  `P04` varchar(50) DEFAULT NULL COMMENT 'Pais da empresa',
  `P05` varchar(20) DEFAULT NULL COMMENT 'Endereço do empresa',
  `P06` varchar(100) DEFAULT NULL COMMENT 'Bairro do empresa',
  `P07` char(9) DEFAULT NULL COMMENT 'Cep do empresa',
  `P08` varchar(50) DEFAULT NULL COMMENT 'Cidade do empresa',
  `P09` char(2) DEFAULT NULL COMMENT 'UF do empresa',
  `P10` varchar(15) DEFAULT NULL COMMENT 'Telefone da empresa',
  `P11` varchar(100) DEFAULT NULL COMMENT 'Email da empresa',
  `P12` varchar(100) DEFAULT NULL COMMENT 'Site da empresa',
  `P13` tinyint(1) DEFAULT NULL COMMENT 'status do empresa',
  PRIMARY KEY (`P01`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COMMENT='Tabela de dados de empresas usuarias';

--
-- Dumping data for table `tp006`
--

/*!40000 ALTER TABLE `tp006` DISABLE KEYS */;
INSERT INTO `tp006` (`P01`,`P02`,`P03`,`P04`,`P05`,`P06`,`P07`,`P08`,`P09`,`P10`,`P11`,`P12`,`P13`) VALUES 
 (1,'CODEPLEX .LTDA','333554585452','BRASIL','RUA DAS AMERICAS','BELA VISTA','033524254','SÃO PAULO','SP','1131592557','CODEPLEX@CODE.COM.BR','WWW.CODEPLEX.COM.BR',0);
/*!40000 ALTER TABLE `tp006` ENABLE KEYS */;


--
-- Definition of table `usuarios`
--

DROP TABLE IF EXISTS `usuarios`;
CREATE TABLE `usuarios` (
  `CodUsuario` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Nome` varchar(100) NOT NULL,
  `Usuario` varchar(50) NOT NULL,
  `Senha` varchar(25) NOT NULL,
  `Endereco` varchar(200) DEFAULT NULL,
  `Bairro` varchar(100) DEFAULT NULL,
  `CEP` char(9) DEFAULT NULL,
  `Cidade` varchar(50) DEFAULT NULL,
  `UF` char(2) DEFAULT NULL,
  `Empresa` varchar(100) NOT NULL,
  `Status` tinyint(1) NOT NULL,
  PRIMARY KEY (`CodUsuario`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `usuarios`
--

/*!40000 ALTER TABLE `usuarios` DISABLE KEYS */;
INSERT INTO `usuarios` (`CodUsuario`,`Nome`,`Usuario`,`Senha`,`Endereco`,`Bairro`,`CEP`,`Cidade`,`UF`,`Empresa`,`Status`) VALUES 
 (1,'Administrador','admin','admin','Rua mazagão','Patriarca','03555-000','São Paulo','SP','CodePlex',1);
/*!40000 ALTER TABLE `usuarios` ENABLE KEYS */;




/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
